#!/usr/bin/env Rscript
################################################################################
# @ Author       : Pengdong Yan
# @ Email        : yanpd01@snnu.edu.cn
# @ Encoding     : UTF-8
# @ Language     : 
# @ Date         : 2022-03-20 00:03
# @ LastEditTime : 2022-03-22 00:46
# @ Description  : 
################################################################################

Colors <- c()
for ( color in c("Set1", "Set2", "Set3","Paired", "Dark2")) {
  Colors <- c( Colors, brewer.pal(8, color))
}

datBar %>%
    filter(Taxon != "Others") %>%
    ggplot(aes(x = sample, y = count, alluvium = Taxon, stratum = Taxon)) +
    geom_col(
        # stat = "identity",
        aes(fill = Taxon),
        # color = 'black',
        width = 0.6
    ) +
    # geom_stratum(aes(fill = Taxon),width = 0.6)+
    geom_alluvium(aes(fill = Taxon), alpha = .5) +
    scale_y_continuous(expand = c(0, 0)) +
    scale_fill_manual(values = Colors[2:nrow(datNorm)+1]) +
    theme_classic2(12) +
    labs(
        x = NULL,
        y = "Sequence Percent",
        fill = NULL
    ) +
    theme(
        axis.text.x = element_text(angle = 45, vjust = 0.5)
    )

    

